<?php
/**
 * Created by PhpStorm.
 * Date: 2016/7/18
 * Time: 16:53
 */

/**
 * app:
 * �ύ�û���������
 *
 * php:
 * ͨ���û����������ж��Ƿ�ƥ��ɹ�
 * ����ɹ���
 *      ���أ�
 *          �ɹ���־
 *          userinfo
 *
 */

include('userinfo.php');

$RootDir = $_SERVER['DOCUMENT_ROOT'];
include $RootDir.'/utils/mysql/MysqlUtils.php';

$resultReturn = array();

//接收参数
$username=$_POST['username'];
$password=$_POST['password'];
//$username='test1';
//$password='1234';

$conn = conn_mysql();
$query = "select user_id,head_local_path,head_path from user_info where uname = '$username' and pwd = '$password' ";

$result = queryRecord($query,$conn);
$userinfo = new UserInfo();

//连接数据库
while ($row=mysql_fetch_array($result, MYSQL_ASSOC))//通过$row=mysql_fetch_assoc($result)迭代记录
{
    $userid = $row['user_id'];
    $head_local_path = $row['head_local_path'];
    $head_path = $row['head_path'];
    break;
}
if ($userid == null) die("err: 用户或密码不对");

echo $userid . ',' . $head_local_path . ',' . $head_path;
//返回数据
//echo json_encode($userinfo);

mysql_close($conn);
